$(function () {
    var userId=localStorage.getItem("userId");
    $(".mya").live("click",function () {

        var userAddress = $("#address").text();
        if (userAddress.length==0) {
            alert("请先选择地址！");
        }else{
            var flag = confirm("是否确认订单？");
            if (flag){
                $.getJSON("easybuy/Car/order",
                    {"userId":userId,"userAddress":userAddress},
                    function (data) {
                        alert("订单完成！");
                        location.href="BuyCar_Three.html";
                    })
            }
        }


    })
});